<?php $this->section->begin('breadcrumb')?>
<div id="global-breadcrumb">
	<ul>
		<li class="current">Tin tức</li>
	</ul>
</div>
<?php $this->section->end()?>
<?php $this->content->begin()?>
<div class="widget-shell inner-shadow">
	<div class="widget-header">
		<h2>Danh sách sản phẩm</h2>
	</div>
	<div class="widget-body">
		<?php $this->form->begin("CatFilter", array("method" => "get"))?>
		<div class="half margin-bottom-20" style="margin-left: 0">
			<?php $this->form->select("category_id", $categoriesOptions, isset($_GET['category_id']) ?  $_GET['category_id'] : "0")?>
		</div>
		<?php $this->form->end()?>
		<div class="fclear"></div>
		<table class="data-table">
			<thead>
				<tr>
					<th>Tên sản phẩm</th>
					<th>Danh mục sản phẩm</th>
					<th>Ngày đăng</th>
					<th>Lựa chọn</th>
				</tr>
			</thead>
			<tbody>
				<?php foreach ($products as $p):?>
				<tr>
					<td><?php echo $p->name?></td>
					<td><?php echo $p->category_name?></td>
					<td><?php echo date("d/m/Y", strtotime($p->date_create))?></td>
					<td>
                        <a href='<?php echo $this->url->action("edit", array($p->id))?>' class='button ico-btn ico-text-edit tool-tip' title='<?php echo $p->name?>' rel='edit'>
            			</a>
            			<a href='<?php echo $this->url->action("delete", array($p->id))?>' class='button ico-btn ico-text-trash tool-tip' item='<?php echo $p->name?>' title='<?php echo $p->name?>'
            					data='<?php echo $p->id?>' rel='delete'>
            			</a>
                    </td>
				</tr>
				<?php endforeach;?>
			</tbody>
		</table>
		<div class="fclear"></div>
		<div class="global-form-footer">
			<a href="<?php echo $this->url->action("create")?>" class="button">
				<span class="ico-text ico-text-brainstorm"></span>Thêm sản phẩm mới
			</a>
		</div>
	</div>
</div>
<div title="Xác nhận xóa tin tức" id="deleteDialog"></div>
<?php $this->content->end()?>
<?php $this->section->begin("scripts")?>
<?php $this->html->loadJs('Areas/Product/Assets/js/index_controlpanel.js')?>
<?php $this->section->end()?>